#include "CEC2017_F5.h"

namespace Solver
{

CEC2017_F5::CEC2017_F5(std::size_t dim):BaseTestFun(dim, FunType_E::CEC2017_F5_E, DifficultyLevel_E::Easy_E, "CEC2017_F5", "")
{
    passY_ = 1e-12;
    bestY_ = 0;
}

CEC2017_F5::~CEC2017_F5()
{

}

value_t CEC2017_F5::calcMinFun(const VectorXd_t &x)
{
    value_t sum1(0), sum2(0);
    for (auto v : x)
    {
        sum1 += v * v;
        sum2 += std::cos(2 * M_PI * v);
    }

    return sum1 - 10 * sum2 + 10 * x.size();
}

}